package com.heima.article.task;

import com.heima.article.service.IHotArticleService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class HotArticleTask {

    @Autowired
    private IHotArticleService hotArticleService;

    @XxlJob("computeHotArticleJob")
    public ReturnT<String> computeHotArticleJob(String param) throws Exception {
        System.out.println("热点文章计算服务开始执行...");
        // 调用热点文章计算服务
        hotArticleService.compute();
        return ReturnT.SUCCESS;
    }
}
